import {defineStore} from "pinia";
import type {VideoPropertiesModel} from "@/api/course/videoCourse";
import videoCourseApi from "@/api/course/videoCourse";
interface VideoCourseStoreModel {
    VideoPropertiesList: VideoPropertiesModel[]
}
const initVideoCourseData = ():VideoCourseStoreModel => ({
    VideoPropertiesList: []
})


export const useVideoCourseStore = defineStore('videoCourse', {
    state: ():VideoCourseStoreModel => initVideoCourseData(),
    actions: {
        // 获取选择属性列表
        async getVideoPropertiesList() {
            try {
                this.VideoPropertiesList = await videoCourseApi.getVideoProperties();
            }catch (err) {
                alert("获取课程分类属性失败");
                console.log(err);
            }
        }
    }
})